package jinyilw.swing.rlaf.ui;

import javax.swing.JComponent;
import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.basic.BasicDesktopIconUI;
import java.awt.BorderLayout;
import java.awt.Graphics;

/**
 * @author Jinyi
 */
public class RDesktopIconUI extends BasicDesktopIconUI
{
	public static ComponentUI createUI(JComponent c)
	{
		return new RDesktopIconUI();
	}

	@Override
	public void installUI(JComponent c)
	{
		super.installUI(c);
		c.setOpaque(false);
		desktopIcon.setBorder(new RInternalFrameBorder(1, 0));
	}

	@Override
	public void update(Graphics g, JComponent c)
	{
	}

	@Override
	protected void installComponents()
	{
		iconPane = new RInternalFrameTitlePane(frame);
		desktopIcon.setLayout(new BorderLayout());
		desktopIcon.add(iconPane, BorderLayout.CENTER);
	}
}
